﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/*
    2012-2-17 David检查正常
 */
namespace Benefit.Service.Sys
{
    /// <summary>
    /// 小组，组长关系，这个应该来通过网页手动操作
    /// </summary>
    public class ServiceGroupMaster : Benefit.Interface.Sys.IGroupMaster
    {
        Benefit.DB.DBManager db = null;
        public ServiceGroupMaster(Benefit.DB.DBManager db)
        {
            this.db = db;
        }

        public List<Models.Sys.GroupMaster> GetGroupMasterId(int groupid)
        {
            var query = db.GroupMaster.Where(a => a.GroupId == groupid);
            return query.ToList();
        }

        public List<Models.Sys.GroupMaster> GetList()
        {
            var query = db.GroupMaster.ToList();
            return query;
        }

        public void Insert(Models.Sys.GroupMaster gm)
        {
            db.GroupMaster.Add(gm);
            db.SaveChanges();
        }
    }
}